import { userStore } from '@/store/userStore';
import { Directive, ref, watch } from 'vue';
const btn: Directive<HTMLInputElement, number> = (el, binding) => {
  const value = binding.value;

  if (value) {
    watch(
      () => userStore().userInfo.permissions,
      permissionsValue => {
        if (!(permissionsValue & value)) {
          el.remove();
        }
      },
      { immediate: true, deep: true }
    );
  }
};

export default btn;
